package com.situ.edu.service.impl;

import com.situ.edu.dao.ITeacherStuDao;
import com.situ.edu.dao.impl.TeacherStuDaoImpl;
import com.situ.edu.pojo.entity.Elective;
import com.situ.edu.pojo.entity.Student;
import com.situ.edu.pojo.entity.Teacher;
import com.situ.edu.pojo.query.StudentQuery;
import com.situ.edu.pojo.vo.StudentVO;
import com.situ.edu.service.ITeacherStuService;
import com.situ.edu.util.PageInfo;

import java.util.List;

public class TeacherStuServiceImpl implements ITeacherStuService {
    private ITeacherStuDao teacherDao = new TeacherStuDaoImpl();

    @Override
    public PageInfo selectByPage(StudentQuery studentQuery) {
        List<StudentVO> list = teacherDao.selectByPage(studentQuery);
        int totalCount = teacherDao.selectTotalCount(studentQuery);

        return PageInfo.ok(totalCount,list);
    }


    @Override
    public void update(Elective elective) {
        teacherDao.update(elective);
    }

    @Override
    public Elective selectByStuId(int id, int courseId) {
        return teacherDao.selectByStuId(id,courseId);
    }

    @Override
    public Teacher selectByTeaId(int userId) {
        return teacherDao.selectByTeaId(userId);
    }
}
